package com.teapos.enumtype;

public enum TeaUnitEnum {
	
	JIAN(1, "整装"),
	PIAN(2, "散装"),
	PAO(3, "克"),
	DESSERT(4, "份"),
	TONG(5, "桶");
	
	private int code;
	private String desc;
	private TeaUnitEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public static TeaUnitEnum getEnumByCode(int code) {
		TeaUnitEnum[] enums = TeaUnitEnum.values();
		for(TeaUnitEnum enumtype:enums) {
			if(enumtype.getCode()==code) return enumtype;
		}
		return null;
	}

}
